const mongoose = require('mongoose')

const schema = new mongoose.Schema({
    username: { type: String },
    password: {
        // 散列加密的方法
        type: String,
        select:false, 
        set(val) {
          return require('bcrypt').hashSync(val,10)
        }
    }
})

module.exports = mongoose.model('AdminUser', schema)